import React, { Component } from 'react';
import { Link, routerRedux } from 'dva/router';
import { connect } from 'dva';
import { List, InputItem,NavBar, Checkbox, Toast, Flex,Icon,WingBlank,Button,Radio, Modal, Grid} from 'antd-mobile';
import NavTopBar from '../../components/NavTopBar/NavTopBar';
import Img from "../../components/Img/Img";
import { createForm } from 'rc-form';
import MyScroll from "../../components/MyScroll/MyScroll";
import { p, p_text, button_p } from './returnSuccess.less'

import paySuccesssvg from "../../assets/img/paySuccess.svg";


class ReturnDetail extends Component {
    constructor(props) {
        super(props);
        this.state = {

        };
    }

    render() {
        const {dispatch} = this.props;
        const data = this.props.match.params.data || "";
        console.log(data, "data");

        return (
            <Flex style={{height: "100%", width: "100%", backgroundColor: "#fff"}} direction="column">
                <NavTopBar noBack={true} dispatch={dispatch} title=" 售后管理"/>
                <Icon type={paySuccesssvg.id} style={{width:"40%", height: "40%", margin: "0 auto", transform: "translate(.4rem)"}}/>
                <p className={ p_text } style={{fontSize:".38rem"}}>售后服务单申请成功</p>
                <p className={ p_text }>申请时间:&#12288;{ data.split(",")[1] }</p>
                <p className={ p_text }>申请类型:&#12288;{ +data.split(",")[2] ? data.split(",")[2] == 1 ? "订单退货" : "订单仅退款" : "订单换货" }</p>

                <div className={ button_p } style={{marginTop:".4rem"}}>
                    <p onClick={() => dispatch(routerRedux.replace({pathname: '/afterSale'}))}>售后首页</p>
                    <p onClick={() => dispatch(routerRedux.replace({pathname: `/returnDetail/${[data.split(",")[0], data.split(",")[2]]}`}))}>进度查询</p>
                </div>

            </Flex>
        )

    }


}

export default connect(({ orderList }) => ({ orderList }))(createForm()(ReturnDetail));
